<template>
  <div class="doctor">
    <nuxt-link :to="`/doctor/${datas.user_id}`">
      <div
        class="doctor-photo"
        :style="{background: `url('${datas.user_photo ? datas.user_photo : ''}') center center no-repeat`,backgroundSize:'cover'}"
      >
        <div class="doctor-photo-authentication" />
      </div>
    </nuxt-link>
    <div class="doctor-content">
      <nuxt-link :to="`/doctor/${datas.user_id}`">
        <div class="doctor-content-title">
          <div class="doctor-name">
            {{ datas.user_name }}
          </div>
          <div class="doctor-position">
            {{ datas.user_attributes?datas.user_attributes.doctor_title:'' }} |
            从业{{ disYears(datas.user_attributes.working_seniority) }}年
          </div>
        </div>
        <div class="doctor-content-hospital-wrap">
          <div class="doctor-content-hospital-text">
            医院：
          </div>
          <div class="doctor-content-hospital">
            {{ datas.user_attributes.hospital_name }}
          </div>
        </div>
        <div class="doctor-good-at">
          <div class="doctor-good-at-text">
            擅长：
          </div>
          <div
            v-if="datas.user_attributes.statistic"
            class="doctor-speciality-wrap-diary"
          >
            <div
              v-for="i in datas.user_attributes.statistic"
              :key="i.id"
              class="doctor-speciality-content-diary"
            >
              <div> {{ i.name }} <span> {{ i.case_count }}</span>例</div>
            </div>
          </div>
        </div>
      </nuxt-link>
    </div>
    <nuxt-link to="/aboutus" rel="nofollow">
      <div class="doctor-right">
        <div class="product-right-icon" />
        <div class="product-right-text">
          免费咨询
        </div>
      </div>
    </nuxt-link>
  </div>
</template>
<script>
import { disYears } from '@/utils/util'
export default {
  props: {
    datas: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      disYears
    }
  }
}
</script>
<style scoped lang="scss">
.doctor {
  width: 780px;
  height: 80px;
  background: rgba(246, 246, 246, 1);
  border-radius: 4px;
  margin-top: 10px;
  padding: 10px;
  display: flex;
  justify-content: center;
  .doctor-photo:hover{
    cursor: pointer;
  }
  .doctor-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
    .doctor-photo-authentication {
      width: 24px;
      height: 24px;
      background: url("~assets/img/authentication.png") center center no-repeat;
      background-size: 100% 100%;
      position: absolute;
      right: 0px;
      bottom: 0px;
    }
  }
  .doctor-content:hover{
    cursor: pointer;
  }
  .doctor-content {
    margin-left: 32px;
    flex: 1;
    .doctor-content-title {
      display: flex;
      align-items: center;
      .doctor-name {
        font-size: 16px;
        font-weight: 600;
        color: rgba(51, 51, 51, 1);
        line-height: 22px;
      }
      .doctor-position {
        font-size: 12px;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        line-height: 17px;
        margin-left: 5px;
      }
    }
    .doctor-content-hospital-wrap {
      display: flex;
      font-size: 11px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 16px;
      margin-top: 2px;
    }
    .doctor-good-at {
      margin-top: 2px;
      display: flex;
    }
    .doctor-good-at-text {
      font-size: 11px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 16px;
    }
    .doctor-speciality-wrap-diary {
      display: flex;
      .doctor-speciality-content-diary {
        background: rgba(255, 255, 255, 1);
        border-radius: 15px;
        padding: 1px 9px;
        font-size: 10px;
        font-weight: 400;
        color: rgba(102, 102, 102, 1);
        line-height: 14px;
        margin-right: 5px;
        span {
          font-size: 11px;
          font-weight: 400;
          color: #333;
          line-height: 16px;
        }
      }
    }
  }
  .doctor-right {
    width: 54px;
    margin-right: 10px;
    margin-top: 19px;
    text-align: center;
    .product-right-icon {
      width: 23px;
      height: 21px;
      background: url("~assets/img/consultation-icon.png") center center no-repeat;
      background-size: 100% 100%;
      margin: 0 auto;
    }
    .product-right-icon:hover {
      cursor: pointer;
    }
    .product-right-text {
      font-size: 12px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
      margin-top: 4px;
    }
    .product-right-text:hover {
      cursor: pointer;
    }
  }
}
</style>
